package com.sun.base.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.sun.base.model.User;

public interface UserMapper {
	@Insert("insert into users(name,birthday) values(#{name},#{birthday})")
	public void save(User user);

	@Update("update users set name=#{name},birthday=#{birthday} where id=#{id}")
	public boolean update(User user);

	@Delete("delete from users where id=#{id}")
	public boolean delete(int id);

	@Select("select * from users where id=#{id}")
	public User findById(int id);

	@Select("select * from users")
	public List<User> findAll();

	public void saveByConfig(User user);

	public User searchByName(@Param("name") String name);
}
